import request from "@/utils/request";
/**
 * GET /admin/acl/user/{page}/{limit}
获取管理用户分页列表
 */
export const reqUserList = (page, limit, username = null) => {
  return request.get(`/admin/acl/user/${page}/${limit}`, {
    params: {
      username,
    },
  });
};
/**
 * GET /admin/acl/user/toAssign/{userId}
根据用户获取角色数据
 */
export const reqUserAssignById = (userId) => {
  return request.get(`/admin/acl/user/toAssign/${userId}`);
};
/**
 * POST /admin/acl/user/save
新增管理用户
 */
export const reqAddUser = (addUserInfo) => {
  return request.post("/admin/acl/user/save", addUserInfo);
};
/**
 * DELETE /admin/acl/user/remove/{id}
删除管理用户
 */
export const reqDeleteUser = (id) => {
  return request.delete(`/admin/acl/user/remove/${id}`);
};
/**
 * POST /admin/acl/user/doAssign
根据用户分配角色
 */
export const reqAddUserToAssign = (userId, roleId) => {
  return request.post("/admin/acl/user/doAssign", null, {
    params: {
      userId,
      roleId,
    },
  });
};
/**
 * GET /admin/acl/user/get/{id}
获取管理用户
 */
export const reqAclUserById = (id) => {
  return request.get(`/admin/acl/user/get/${id}`);
};
/**
 * /admin/acl/user/update
修改管理用户
 */
export const reqUpdataUser = (userInfo) => {
  return request.put("/admin/acl/user/update", userInfo);
};
